package com.farsunset.cim.client.android;



import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.buffer.ChannelBuffers;
import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.ChannelHandlerContext;
import org.jboss.netty.handler.codec.oneone.OneToOneEncoder;

public class MessageEncoder extends OneToOneEncoder {

	@Override
	protected Object encode(ChannelHandlerContext aCtx, Channel channel,
			Object aMsg) throws Exception {		
	
		ChannelBuffer aOut = ChannelBuffers.dynamicBuffer();
		CommandCodec.encode(aCtx, (Command)aMsg, aOut);		
		return aOut;
		
	}
}